package com.example.demo.controller;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.bind.annotation.*;

import java.util.HashMap;
import java.util.Map;

@RestController
@RequestMapping("/arg")
public class TestArgumentController {
    private static final Logger log= LoggerFactory.getLogger(TestArgumentController.class);

    @GetMapping("/holiday/{day}")
    public Object holiday(@PathVariable String day){
        log.debug("获取请求路径参数："+day);
        Map<String,String> map = new HashMap<>();
        map.put("ok","true");
        return map;
    }

    @PostMapping("/login")
    public Object login(@RequestParam String username,@RequestParam String password){
        log.debug("获取请求路径参数：username="+username+",password="+password);
        Map<String,String> map = new HashMap<>();
        map.put("顾淇","666");
        return map;
    }
}
